
#include "features2d-test.h"

using namespace cv;

bool shiftRectY(Rect &rect,Mat mat,int shMult);
bool shiftRectX(Rect &rect,Mat mat,int shMult);

int findColorBreak(){
	maderfaker::ImgShower im;
	int rectSize = 19;
	

	Mat input, rectMat;
	input = imread(IMG_COLOR_BREAK_SMALL);
	//im.sh("input", input);

	Rect rect(0,0,rectSize,rectSize);


	im.sh("input", input);
	
	do{
		rectMat = Mat(input, rect);
	}
	while(shiftRectX(rect,input,1));
	

	im.sh("rectMat", rectMat);
	
	

	return 0;
}

Mat createMat(Mat &input, Rect &rect, Scalar overSize){
	return Mat();
}

bool shiftRectY(Rect &rect,Mat mat,int shMult){
	if(shMult != 0){
		int top = rect.y + shMult * rect.height;
		int bottom = top + rect.height;

		if(bottom < 0 || top > mat.rows){ return false;}
		rect.y = top;
	}
	return true;
}

bool shiftRectX(Rect &rect,Mat mat,int shMult){
	if(shMult != 0){
		int left = rect.x + shMult * rect.width;
		int right = left + rect.width;

		if(right < 0 || left > mat.rows){ return false;}
		rect.x = left;
	}
	return true;
}